1. Field of the Invention
The present invention relates to a microcomputer having a built-in oscillation circuit. The invention also relates to a microcomputer-containing apparatus and an IC card each using such a microcomputer having a built-in oscillation circuit.
2. Description of the Related Art
FIG. 12 illustrates the construction of a conventional microcomputer. A microcomputer 14 comprises therein: a CPU 15; an oscillation circuit 16 and a memory (RAM) 17, both of which are connected to the CPU 15; and a battery 18 for supplying power to the respective circuits. When a start signal is input into the microcomputer 14 from an external unit, an oscillator arranged within the oscillation circuit 16 starts oscillation, and the CPU 15 is actuated to execute data processing. Upon completion of data processing, the CPU 15 executes a stop command and goes into a halt condition.
The CPU 15 and the oscillation circuit 16 are supplied with the power from the battery 18 so as to be actuated. A threshold of the power supply voltage for ensuring normal operation of the CPU 15 is conventionally set higher than that of the oscillation circuit 16. That is, as shown in FIG. 13, a threshold Vth 1 of the CPU 15 is set higher than a threshold Vth 2 of the oscillation circuit 16. Consequently, the battery 18 is dissipated with a lapse of time, and the power supply voltage V is accordingly reduced so as to become lower than the threshold Vth 1 of the CPU 15 at time T1, thereby making it impossible for the CPU 15 to operate normally. However, until the power supply voltage V reaches time T2 at which voltage V starts to become lower than the threshold Vth 2 of the oscillation circuit 16, the oscillation circuit 16 is able to operate normally from the voltage V supplied from the battery 18 so that it can supply an oscillation signal to the CPU 15. In consequence, the CPU 15 runs out of control and executes erroneous data processing, which might write abnormal data into the memory 17 and destroy data stored within the memory 17.
Generally, a control circuit 15a is provided for the CPU 15, and a watch dog timer is arranged within the control circuit 15a so as to monitor runaway of the CPU 15. The watch dog timer monitors the operation of the CPU 15 after every lapse of a predetermined monitoring period and resets the CPU 15 upon detecting abnormal operation of the CPU 15. However, if the CPU 15 runs away out of control due to a reduction in the power supply voltage V, the watch dog timer provided for the CPU 15 is also unable to operate normally, thereby making it impossible to reset the CPU 15.
Further, after time T1 at which the power supply voltage V becomes lower than the threshold Vth 1 of the CPU 15, there is sharp dissipation in the battery 18 due to unnecessary operation of the oscillation circuit 16. This might cause a failure in backup of the memory 17 and further give rise to a danger of erasing the data stored in the memory 17.
As described above, a conventional battery-operated microcomputer having a built-in oscillation circuit presents a problem in that dissipation in a battery might bring about runaway of the CPU and further leads to destruction of the content of a memory.